package com.xjtu.chapter05.ex5_2;

/**
 * @author yjq
 * @version 1.0
 * @date 2021/8/16 16:00
 */
public class SingerStar extends Star implements CanDance, CanPerform {

    String famousSong;

    public SingerStar(String name, int age, char sex, String famousSong) {
        super(name, age, sex);
        this.famousSong = famousSong;
    }

    void sing() {
        System.out.println("Singer:sing");
    }

    @Override
    public void dance() {
        System.out.println("Singer:dance");
    }

    @Override
    public void perform() {
        System.out.println("Singer:perform");
    }

    @Override
    public String toString() {
        return super.toString() + ", " +
                "famousSong='" + famousSong + "'";
    }
}
